namespace Pinwheel.Kernel
{
    public interface IComponent
    {
        void OnAttach(IService service);
        
        void OnDetach(IService service);
    }
        
    public interface IComponentContainer
    {
        void AddComponent<TComponent>(TComponent component) where TComponent : IComponent;
        
        void RemoveComponent<TComponent>(TComponent component) where TComponent : IComponent;
        
        bool TryGetComponent<TComponent>(out TComponent component) where TComponent : IComponent;
    }
    
    public interface ISendHandler
    {
        TaskCompletionSource<IMessage> HandleSend(ref ServiceMessage message);
    }
    
    public interface IReceiveHandler
    {
        TaskCompletionSource<IMessage> HandleReceive(ref ServiceMessage message);
    }
}